
import { defaultRadioProps } from "@/utils/default";
import type { QuestionRadioPropsType } from "@/utils/type";
import { Typography, Radio, Space } from "antd";

const { Paragraph } = Typography;



export default function QuestionRadio(props: QuestionRadioPropsType) {
  const { title, options = [], value,isVertical } = { ...defaultRadioProps, ...props }
  return (
    <div>
      <Paragraph strong>{title}</Paragraph>
      <Radio.Group value={value} >
        {/* 换行 */}
        <Space style={{ flexWrap: 'wrap'}} direction={isVertical? "vertical" : "horizontal"}>
          {options.map(item => {
            return <Radio value={item.value} key={item.value}>{item.label}</Radio>
          })}
        </Space>
      </Radio.Group>
    </div>
  );
}
